// ex7_12_5.cpp
#include <iostream>

double get_max_arr(double arr[], int n);
int main(void)
{
	double arr1[] = {2.0, 1.0, 13.0, 4.0, 5.0};
	double max1 = get_max_arr(arr1, 5);
	std::cout << "max of array is: " 
		      << max1 << std::endl;
}

double get_max_arr(double arr[], int n)
{
	//double max_tmp;
	int max_idx = 0;
	for (int i = 1; i < n; i++)
	{
		if (arr[max_idx] < arr[i])
			max_idx = i;
	}
	
	//max_tmp = arr[max_idx];
	return arr[max_idx];
}
